<!--公共头部-->
{template 'aitimt/common/header'}
	<style>
		.mui-table-view .mui-media, .mui-table-view .mui-media-body{line-height: 2rem;}
		.mui-slider-indicator.mui-segmented-control .mui-control-item {border-left:1px solid #c1c1c1 ;border-bottom:1px solid #c1c1c1 ;padding: 1px;color: #585858;}
		.mui-slider .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{border-bottom:3px solid #e94709 ;color: #585858;}
		.addtime{padding-top: 10px;font-size: 10px;}
		.mui-table-view .mui-media-object.mui-pull-left{margin-right: 25px;}
		.mui-content>.mui-table-view:first-child{margin: 0;}
		.entry-pro {font-weight: 500;font-size: 15px;color: #000000;background-color: #FFFFFF;padding: 10px 0 1px 5%;}
		.entry-message{position: absolute;width: 100%;height: 85%;font-weight: 500;font-size: 15px;color: #000000;background-color: #FFFFFF;padding: 10px 5% 1px 5%;}
		.entry-message input{height: 36px;border-radius: 8px;}
		.mui-input-group input, .mui-input-group textarea{border: 1px solid #EEEEEE;}
		.mui-input-group:before{height: 0;}
		.mui-bar-tab{display:unset;height: 40px!important;font-size: 15px;line-height: 40px;}
		.mui-bar-tab .mui-tab-item{vertical-align:unset;}
		.entry-message p{margin-top: 3%;margin-bottom: 1px;}
		.entry-message input::-webkit-input-placeholder{font-size:14px;color: #bcbcbc;}
		.entry-select{position: absolute;width: 95%;height: 4%;border: 1px solid #bcbcbc;margin-bottom: 10px;}
		.mui-btn-block{position: absolute;top: 0;width: 22%;left: 25%;font-size: 14px;margin: 0;padding: 0 10px;background: #a0a0a0;line-height: inherit;color: #fff;text-align: center;}
		.mui-btn-block option:first-child{font-size: 14px;margin: 0;padding: 0;color: #bcbcbc;}
	</style>

	<header class="mui-bar mui-bar-nav">
		<a class="top-return mui-action-back"><img src="{$aideUrl}app/resource/aitimt/images/return.png" ></a>
		<a class="top-logo"><img src="{$aideUrl}app/resource/aitimt/images/logo.png" ></a>
		<!--公共菜单start -->
		{template 'aitimt/common/menu'}
		<!-- 公共菜单end-->
	</header>

		<div class="mui-content">

			<div style="font-size: 18px;color: #e94709;margin-left: 5%; padding: 2% 0; font-weight: 500;">
				给我们留言
			</div>
			<div class="entry-message">
				<form class="mui-input-group" action="" method="post" id="formdata">
					<p>欢迎来到爱计时赛事平台，您如果有合作意向或任何建议可以留下您的联系信息，我们将尽快跟进您的需求</p>

					<p>姓名*:</p>
					<input type="text" name="cooper[name]" placeholder="请输入姓名" id="name" value="" />
					<p>手机号码*:</p>
					<input type="text" name="cooper[mobile]" placeholder="请输入手机号码" id="mobile" value=""/>
					<p>邮箱*:</p>
					<input type="text" name="cooper[email]" placeholder="请输入邮箱" id="email" value="" />
					<div style="position:absolute;width:90%;margin-top:3%;margin-bottom: 15%;">
						<p style="margin:0;">咨询分类*:</p>
						<select class="mui-btn mui-btn-block" name="cooper[type]" id="type">
								<option value="">请选择</option>
								<option value="合作">合作</option>
								<option value="咨询">咨询</option>
								<option value="其他">其他</option>
						</select>
						<p>咨询详情*:</p>
						<textarea style="height: 100px;font-size: 15px;border-radius: 8px;width: 111%;" name="cooper[content]" placeholder="请输入您的咨询内容" id="content"></textarea>
					</div>
				</form>
			</div>
		</div>
		<!-- 公共底部start -->
		<nav class="mui-bar mui-bar-tab">
			<a class="mui-tab-item mui-action-back" style="background: #a0a0a0;color: #FFFFFF;" >
				<span class="mui-tab-label">取消</span>
			</a>
			<a class="mui-tab-item mui-active " style="background: #e94709;color: #FFFFFF;" onclick="check()">
				<span class="mui-tab-label">提交</span>
			</a>
		</nav>
		<!-- 公共底部end -->
		<script type="text/javascript">
            function check() {
                var  name=document.getElementById('name');
                if (!name.value) {
                    mui.toast('请输入名字');
                    $("input[name='cooper[name]']").focus();
                    return false;
                }
                var  mobile=document.getElementById('mobile');
                if (!mobile.value) {
                    $("input[name='cooper[mobile]']").focus();
                    mui.toast('请输入手机号码');
                    return false;
                }else {
                    var tel = mobile.value;//获取输入身份证
                    var yidongreg = /^(134[012345678]\d{7}|1[34578][012356789]\d{8})$/;
                    var dianxinreg = /^1[3578][01379]\d{8}$/;
                    var liantongreg = /^1[34578][01256]\d{8}$/;
                    //var reg = /^1[3|4|5|7|8]\d{9}$/;//这一种也可以
                    if (yidongreg.test(tel) || dianxinreg.test(tel) || liantongreg.test(tel))
                    {
                    }else {
                        $("input[name='cooper[mobile]']").focus();
                        mui.toast('请输入正确的手机号码');
                        return false;
                    }

                }
                var  email=document.getElementById('email');
                if (!email.value) {
                    $("input[name='cooper[email]']").focus();
                    mui.toast('请输入邮箱');
                    return false;
                }else {
                    var emailreg = /^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
                    if (emailreg.test(email.value))
                    {
                    }else {
                        $("input[name='cooper[email]']").focus();
                        mui.toast('请输入正确的邮箱');
                        return false;
                    }
                }
                var  type=document.getElementById('type');
                if (!type.options[type.selectedIndex].value) {
                    mui.toast('请选择咨询分类');
                    return false;
                }
                var  content=document.getElementById('content');
                if (!content.value) {
                    mui.toast('请输入咨询内容');
                    $("input[name='cooper[content]']").focus();
                    return false;
                }
                $.post("{php echo app_url('home/index/cooper')}", $("#formdata").serialize(), function(data){
                    if(data.errno == 1){
                        util.alert(data.errmsg);
                    }
                    else {
                        var btnArray = ['确定'];
                        mui.confirm(data.errmsg,'',btnArray, function(e) {
                            location.href = "{php echo app_url('home/index/cooperation')}";
                        });
                    }
                },"json");

            }
		</script>

	</body>

</html>
